<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.prime.com.tr/ui"            
        xmlns:c="http://java.sun.com/jsp/jstl/core"
	template="template.xhtml">
	
	<ui:define name="head">
       
	</ui:define>
 
	<ui:define name="content">

        <h:form>
            <h:outputText value="Nome:"/>
            <p:inputText id="nome" value="#{albumController.album.nome}" required="true" requiredMessage="Campo nome obrigatório" maxlength="20"/>
            
            <p:commandButton update="listaPessoas"
                             value="Salvar"                             
                             image="ui-icon-disk" action="#{albumController.adicionarAlbum}" ajax="false"/>
            
            <br/>
            
            <c:forEach id="idAlbum" items="#{albumController.albumToUser}" var="album">
                   
                    <h:outputLink value="#{facesContext.externalContext.requestContextPath}/fotos.jsf?albumId=#{album.id}">
                        <h:outputText value="#{album.nome}" />
                    </h:outputLink>
                              
                                       
                   <br/>
            </c:forEach>              
            <br/>
            
        </h:form>                      
         
                                
        
            
            
        </ui:define>
</ui:composition>
